<template>
  <div>
    <div> {{ num }}</div>
    <EmitCmp @child-fn="parentFn" :value="num"></EmitCmp>

    <div> {{ num }}</div>
    <VModelCmp v-model="num"></VModelCmp>

    <div>{{num}}</div>
    <SyncCmp :value.sync="num"></SyncCmp>/
  </div>
</template>
<script>
import VModelCmp from "@/views/hello/TestCmpMessage/VModelCmp.vue";
import EmitCmp from "@/views/hello/TestCmpMessage/EmitCmp.vue";
import SyncCmp from "@/views/hello/TestCmpMessage/SyncCmp.vue";

export default {
  name: "TestCmp",
  components: {SyncCmp, VModelCmp, EmitCmp},
  data() {
    return {
      num: 100,
    }
  },
  methods: {
    parentFn(payload) {
      this.num = payload;
    }
  },
}
</script>

<style scoped lang="scss">

</style>